Claim the on-screen blocks instead of driving core's required channel - #420
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
5db86be to
e68907c
Compare
|
Carries into https://github.com/orgs/BristolMyersSquibb/discussions/489 after BristolMyersSquibb/blockr.core#337's rework: dock declares its opening screen through an |
|
Revised request, replacing my comment above, to follow BristolMyersSquibb/blockr.core#337's rework under https://github.com/orgs/BristolMyersSquibb/discussions/489:
The |
Core retired the per-block `required` channel, so the dock declares itself the gating front-end and holds what it shows as a `sustain` claim under that owner label. The settled layout echo now drives two writers of the single update channel, so both fold into the pending payload rather than replacing it.
lintr 3.4.0's assignment_linter rejects a `<<-` whose target lives only inside the closure, which is exactly the shape of the sent-set cache.
Core now takes the gating front-end's declaration from what its callback returns, and seeds the opening claim before the first flush. The dock returns gate_claim() with the active view's front panels rather than writing visibility$gate(), and no longer sends that opening claim through update: block_claim() starts from it and sends only a change.
The update tally now counts the dock's claims, and a narrow view reports its stored grid as its live one, so neither can show that the echo wrote nothing back. Read the stored grid through a test export instead.
blockr.ui's bare blockr.core remote conflicts with this branch's pin, so dependency resolution fails. Its 321-unified-demand branch pins the same core branch; drop both pins once blockr.core#337 merges.
e68907c to
1281bd5
Compare
|
Done on all three:
One test outside that list had to change: the #413 narrow-viewport test asserted |
|
BristolMyersSquibb/blockr.core#337 renamed the demand vocabulary this PR adopts, so this PR needs to follow before #337 can merge: #337's deps block points the merge queue's revdep check at this branch. Nothing was released under the old names, so there is no deprecation path.
On this branch that means:
The comments describing a |
The rename in blockr.core#337 turned gate_claim() into eager(), the `sustain` payload component into `eager` and the declaration's class into "eager_blocks", and retired "claim" as a word for any of it. The callback now returns eager(owner, opening), under `eager` rather than `gate`, and the dock sends its on-screen blocks as an `eager` set. Its own wording follows: block_claim() is eager_holder(), and the tests read core's rv$eager_blocks() where they read rv$claims(). A payload under a name core does not read is accepted and changes nothing, and the unit tests check the payload against names they spell out themselves, so a rename missed in both would pass them. A new test sends the dock's payload through core's board server and checks that core's eager set moved. The build-ledger comment called core's "Show code" a peer owner holding blocks. It asks for construction, which names no owner.
|
Applied. Beyond the list:
|
Core's main now carries eager(), and the branch the pin named was deleted with the merge, so blockr.core resolves from main again. That also ends the conflict that pinned blockr.ui: its bare blockr.core remote matches the dock's once more.
Summary
requiredchannel (Fold front-end demand into the one multi-owner claim set blockr.core#337), sovisibility$required[[id]](…)fails withattempt to apply non-function. The dock now states its evaluation demand as the blocks it holds eager, under its own owner label.eager(owner, opening), with the active view's front panels as the opening set, which core seeds as it runs the callbacks, before the first flush decides what to construct. Nothing travels throughupdateto open the set:eager_holder()starts from the declared set and sends only a change, oneeagerpayload with asetdelta per view switch._stateecho drives two writers of the singleupdatechannel, the geometry mirror and the eager holder, so both fold into whatever is pending (fold_update()) rather than one replacing the other.constructcomponent builds every id it names in the flush that applies it, where the retired channel'sFALSEstate was paced; fronting a tab holds its block eager instead.Test changes
The #413 narrow-viewport test asserted
commit_count == 0to show that the echo writes nothing back. That export counts every update payload, and the dock'seagerpayloads are update payloads: a narrow load sends two, both eager updates according to core's debug log, with no grid commit among them. A narrow view also reports its stored grid as its live one, soroundtrip_stableholds trivially and cannot stand in. The test now reads the stored grid through a newstored_gridstest export and compares it with the authored one; wiring the mirror in narrow mode makes it fail.Two new tests drive core's own board server with the dock's callback. One checks that the declared owner becomes the gate, and its blocks that owner's eager set, before any flush, with nothing sent to get there. The other sends the dock's payload and checks that core's eager set moved. Core passes unknown top-level keys through for board subclasses, so a payload under a name core does not read is accepted and changes nothing, and the unit tests cannot see that because they check the payload against names they spell out themselves. With the payload and those names both left at
sustain, only this test fails. The fake visibility bundle the other tests use is what hid the original breakage from them.The
#377test for a barerequiredwrite reading back as a built card is dropped rather than ported: demand left the visibility bundle, so the dock is the only writer ofvisibleleft.Fixes #417